import {createRouter, createWebHashHistory} from 'vue-router'
import Login from '../views/Login.vue'
import Home from "../views/Home";
import SysUser from "../views/sys/SysUser";
import SysRole from "../views/sys/SysRole";

const routes = [
    {
        path: '/',
        name: 'Login',
        component: Login,
        hidden: true
    }, {
        path: '/home',
        name: '系统设置',
        component: Home,//直接加载页面
        hidden: false,
        children: [
            {
                path: '/sys/SysUser',
                name: '用户',
                hidden: false,
                component: () => import(/* webpackChunkName: "about" */ '../views/sys/SysUser') // 懒加载页面
                // component: UserSet //直接加载页面
            }, {
                path: '/sys/SysRole',
                name: '角色',
                hidden: false,
                component: () => import(/* webpackChunkName: "about" */ '../views/sys/SysRole') // 懒加载页面
                // component: RoleSet //直接加载页面
            }
        ]
    }
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
